﻿using DriverEDU_UI.FrmStudent;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using WeifenLuo.WinFormsUI.Docking;

namespace DriverEDU_UI
{
    public partial class FrmMenu : DockContent
    {
        public FrmMenu()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 单击学员信息事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LblStudent_Click(object sender, EventArgs e)
        {
            //打开学员信息管理子窗体
            FrmStudentInfo studentInfo = new FrmStudentInfo();
            //遍历所有容器内的所有子窗体
            foreach (DockContent item in FrmMain.frmMain.DockPanelMain.Contents)
            {
                //判断当前子窗体是否是此窗体
                if (item.Name.Equals(studentInfo.Name))
                {
                    //激活焦点
                    item.Activate();
                    return;
                }
            }
            //打开子窗体
            studentInfo.Show(FrmMain.frmMain.DockPanelMain);
        }
    }
}
